<?php
ini_set("display_errors", "On");
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
require_once __DIR__ . "/../FoundaoVideoSDK.class.php";
$videoUrl = "http://toutiao-cdn-jper.foundao.com/ovesystem/data/material/2018/04/09/11804120919141010818211_b964d036233e6a4098427b0bb72ee1e4.mp4";
$handle = new FoundaoVideoSDK();
$ret = $handle->createInputVideo($videoUrl);
if (empty($ret)) {
    var_dump($handle->getError());
    exit();
}
$ret = $handle->createOutput("test.mp4", "temp", "video");
if (empty($ret)) {
    var_dump($handle->getError());
    exit();
}
$job_id = $handle->submitJob();
if (!empty($job_id)) {
    while (true) {
        $data = $handle->getJobStatus($job_id);
        var_dump($data);
        if ($data['status'] == 2) {
            exit();
        }
        sleep(1);
    }
}
